<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%--
Created by GaoXiang
Date: 2018-04-14 15:34:14 周六
Version: 1.0
停车场添加页面
--%>

<div class="portlet light">

    <div class="portlet-body form">
        <!-- BEGIN FORM-->
        <form action="#" class="form-horizontal" id="edit-module">
            <div class="form-body">

                <div class="row">
                    <div class="col-md-6 hide">
                        <div class="form-group">
                            <label class="control-label col-md-3">ID</label>
                            <div class="col-md-9">
                                <input type="text" class="form-control" name="id" value="${parkDepot.id}" placeholder="ID">
                            </div>
                        </div>
                    </div>

                    <div class="col-md-6">
                        <div class="form-group">
                            <label class="control-label col-md-4">预约费用</label>
                            <div class="col-md-8">
                                <input type="text" class="form-control" required number="true" name="orderFee" placeholder="预约费用" value="${parkDepot.orderFee}">
                            </div>
                        </div>
                    </div>
                    
                    <div class="col-md-12">
                        <div class="form-group">
                            <label class="control-label col-md-2">收费规则</label>
                            <div class="col-md-8">
                                <textarea rows="5" class="form-control" required name="chargeRules" placeholder="收费规则">${parkDepot.chargeRules}</textarea>
                            </div>
                        </div>
                    </div>

                </div>
            </div>
        </form>
        <!-- END FORM-->
    </div>
</div>
<!-- script 开始 -->
<script>

    $(function(){
        //初始化页面
        initPage();
    });

    /**
     * 保存停车场
     */
    function save(){
        var param = tools.formParams("edit-module");
        if(tools.valid("edit-module")){
            tools.post("/parkDepot/editOneSelf",param,function(data){
                if(data.success){
                    layer.msg('停车场修改成功', {icon: 1,time:1000},function(){
                        //刷新列表页面
                        toPage(null);
                        //关闭弹窗
                        layer.close(layer_editRelate);
                    });
                }else{
                    tools.errorTip(data.code,data.message);
                }
            });
        }
    }

</script>
<!-- script 结束 -->